Skip to content

Keep Cargo.lock current on the release branch and check it - #166

Merged
ckir merged 1 commit into
mainfrom
ci/cargo-lock-refresh
Nov 21, 2026
Merged

ckir merged 1 commit into
mainfrom
ci/cargo-lock-refresh

Conversation

@ckir

@ckir ckir commented Nov 21, 2026

Copy link
Copy Markdown
Owner

What

release-please bumps each crate's Cargo.toml but looks for a lock file inside the package folder, so the workspace Cargo.lock at the repository root kept the old version of every crate a release bumped. The next cargo build then rewrote a tracked file (fixed by hand once, in #165).

  • .github/workflows/release-refresh.yml: a new step runs cargo update --workspace on the release branch and Cargo.lock joins the files the refresh commit stages. The step is continue-on-error, like the pins step, with its own failing step at the end, so a cargo failure does not block the other derived files and still turns the job red.
  • .github/workflows/ci.yml: a step in the wiring job runs cargo metadata --locked and fails when the lock file disagrees with the manifests.
  • Justfile: a lock recipe with the same command, first in check so that no later cargo command can quietly rewrite a stale lock file before it is checked.
  • docs/PLUGIN_GUIDELINES.md: the Cargo.lock row now names what fails.

Measured

In a scratch copy with one crate bumped from 0.3.0 to 0.4.0:

  • cargo metadata --locked exits 101.
  • cargo update --workspace changes exactly one line of Cargo.lock (that crate's version) and no dependency; --locked then passes.
  • On an empty cargo home with network, the same command takes under a second; with --offline it fails, so the step uses the network.

Not measured

The refresh step on a real runner. Its first live run is the next release PR that bumps a crate.

🤖 Generated with Claude Code

release-please bumps each crate's Cargo.toml but looks for a lock file inside the package folder, so the workspace Cargo.lock at the root kept the old versions and the next cargo build rewrote a tracked file. The release-refresh job now runs cargo update --workspace, which sets the workspace crates' versions and moves no dependency, and commits Cargo.lock with the other derived files. CI and just check gain a --locked step that fails on a lock file that disagrees with the manifests; in just check it runs first, before any cargo command could rewrite the file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ckir
ckir merged commit 01b18b3 into main Nov 21, 2026
37 checks passed
@ckir
ckir deleted the ci/cargo-lock-refresh branch November 21, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant